# Maintainer: Michał Polański <michal@polanski.me>
pkgname=warp-s3
pkgver=0.7.7
pkgrel=0
pkgdesc="Benchmarking tool for S3"
url="https://github.com/minio/warp"
license="AGPL-3.0"
arch="all !armhf !armv7 !x86" # tests fail on 32-bit architectures
makedepends="go"
source="https://github.com/minio/warp/archive/v$pkgver/warp-s3-$pkgver.tar.gz"
builddir="$srcdir/warp-$pkgver"

export CGO_ENABLED=0
export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

build() {
	go build \
		-ldflags "-X github.com/minio/warp/pkg.Version=$pkgver" \
		-o warp-s3
}

check() {
	go test ./...
}

package() {
	install -Dm755 $pkgname -t "$pkgdir"/usr/bin/
}

sha512sums="
f865971330fcf4ecedf330d1e454e9731a94ce5f9ee1e7c3e05c5d53bd87dedc297dc19ad4bb0e52720f5854a54c78d100494035cbd4ed382dd9d89a4c718b2c  warp-s3-0.7.7.tar.gz
"
